﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace pokerServer.GameManagment.GameTools {

	public class Seat {

		public Table myTable;
		private ushort seatID;
		private Player player;
		private Boolean _isDealer;

		public Seat(Table table, Player p, ushort seat) {
			this.myTable = table;
			this.player = p;
			this.seatID = seat;
			p.tableIndex = seat;
		}
		private void reset() {
			this._isDealer = false;
		}
		public void resetGame() {

		}
		public ushort SeatID {
			get {
				return this.seatID;
			}
		}
		public Boolean isDealer() {
			return this._isDealer;
		}
		public Boolean isPlaying() {
			return this.Player.isPlaying;
		}
		public Player Player {
			get {
				return this.player;
			}
		}

		public void playerAction(GameEngine.GameDecisions gDecision, uint value) {
			this.Player.playerAction(gDecision, value);
		}

		public override string ToString() {
			return string.Format("Seat: {0}\t{1}", this.SeatID, this.player.ToString());
		}

	}


	// Seat Exceptions
	public abstract class SeatException : Exception { }
	public class SeatIsTakenException : SeatException { }
	public class SeatIdNotExists : SeatException { }
}
